
public class TestMainSafe4 {

	public static void main(String[] args) {
		//懒汉式(线程安全，同步方法)[不推荐用]
		Thread t1 = new Thread() {
			@Override
			public void run() {
				System.out.println(Singleton4.class.getSimpleName()+":"+Singleton4.getInstance());
				super.run();
			}
		};
		Thread t2 = new Thread() {
			@Override
			public void run() {
				System.out.println(Singleton4.class.getSimpleName()+":"+Singleton4.getInstance());
				super.run();
			}
		};
		Thread t3 = new Thread() {
			@Override
			public void run() {
				System.out.println(Singleton4.class.getSimpleName()+":"+Singleton4.getInstance());
				super.run();
			}
		};
		Thread t4 = new Thread() {
			@Override
			public void run() {
				System.out.println(Singleton4.class.getSimpleName()+":"+Singleton4.getInstance());
				super.run();
			}
		};
		Thread t5 = new Thread() {
			@Override
			public void run() {
				System.out.println(Singleton4.class.getSimpleName()+":"+Singleton4.getInstance());
				super.run();
			}
		};
		t1.start();
		t2.start();
		t3.start();
		t4.start();
		t5.start();
	}

}
